﻿using AutoMapper;
using B.S.BaseData.Domain.Entities;
using B.S.BaseData.Write.API.Command.LeaveCommand;
using B.S.BaseData.Write.API.Command.MenuCommand;
using B.S.BaseData.Write.API.Command.RoleCommand;
using B.S.BaseData.Write.API.Command.UserCommand;

namespace B.S.BaseData.Write.API
{
    /// <summary>
    /// 映射轮廓
    /// </summary>
    public class MappingProfile:Profile
    {
        /// <summary>
        /// 转换方法
        /// </summary>
        public MappingProfile() 
        {
              CreateMap<AddUserCommand,User>().ReverseMap();
              CreateMap<UpdUserCommand, User>().ReverseMap();
              CreateMap<CreateMenuCommand, Menu>().ReverseMap();
              CreateMap<UpdMenuCommand, Menu>().ReverseMap();
              CreateMap<AddRoleCommand, Role>().ReverseMap();
              CreateMap<UserRoleCommand, UserRole>().ReverseMap();
              CreateMap<CreateLeaveCommand, Leave>().ReverseMap();
              CreateMap<UpdLeaveCommand, Leave>().ReverseMap();
              CreateMap<ApprovalLeaveCommand, Leave>().ReverseMap();
              
        }
    }
}
